package com.core.family.biz.yizhao.service;

import com.core.family.biz.yizhao.domain.po.YzSetting;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * @author hl
 * @version 1.0.0
 * @ClassName YzSettingService.java
 * @Description 类描述
 * @createTime 2023年06月29日 10:57:00
 */
public interface YzSettingService {
    /**
     * 添加文章
     * @param article
     * @return
     */
    YzSetting create(YzSetting article);

    /**
     * 删除文章
     */

    int delete(String id);


    /**
     * 根据id查询
     * @param id
     * @return
     */
    YzSetting get(String id);


    default  YzSetting getForYz(String id){
        List<YzSetting> list=getList(new YzSetting());
        if ( CollectionUtils.isEmpty(list)){
            return null;
        }
        for (YzSetting yzSetting : list) {
            if (yzSetting.getId().equals(id)){
                return yzSetting;
            }
        }
        return list.get(0);
    }



    // 查询列表
    List<YzSetting> getList (YzSetting setting);



}
